home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / theloa1a / frm_load.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-13  |  13.2 KB  |  396 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    BackColor       =   &H80000004&
  4.    Caption         =   "The Loader"
  5.    ClientHeight    =   5370
  6.    ClientLeft      =   165
  7.    ClientTop       =   735
  8.    ClientWidth     =   6915
  9.    FillColor       =   &H00C0C0C0&
  10.    Icon            =   "frm_Loader.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    ScaleHeight     =   5370
  14.    ScaleWidth      =   6915
  15.    StartUpPosition =   3  'Windows Default
  16.    Begin VB.CommandButton cmdPropProg2 
  17.       Caption         =   "Properties"
  18.       Height          =   375
  19.       Left            =   120
  20.       Style           =   1  'Graphical
  21.       TabIndex        =   15
  22.       Top             =   2400
  23.       Width           =   1095
  24.    End
  25.    Begin VB.CommandButton cmdPropProg3 
  26.       Caption         =   "Properties"
  27.       Height          =   375
  28.       Left            =   120
  29.       Style           =   1  'Graphical
  30.       TabIndex        =   14
  31.       Top             =   3120
  32.       Width           =   1095
  33.    End
  34.    Begin VB.CommandButton cmdPropProg4 
  35.       Caption         =   "Properties"
  36.       Height          =   375
  37.       Left            =   120
  38.       Style           =   1  'Graphical
  39.       TabIndex        =   13
  40.       Top             =   3840
  41.       Width           =   1095
  42.    End
  43.    Begin VB.CommandButton cmdPropProg5 
  44.       Caption         =   "Properties"
  45.       Height          =   375
  46.       Left            =   120
  47.       Style           =   1  'Graphical
  48.       TabIndex        =   12
  49.       Top             =   4560
  50.       Width           =   1095
  51.    End
  52.    Begin VB.CommandButton cmdPropProg1 
  53.       Caption         =   "Properties"
  54.       Height          =   375
  55.       Left            =   120
  56.       Style           =   1  'Graphical
  57.       TabIndex        =   11
  58.       Top             =   1680
  59.       Width           =   1095
  60.    End
  61.    Begin VB.CommandButton cmdProg5 
  62.       Caption         =   "Program no. 5"
  63.       Height          =   615
  64.       Left            =   1440
  65.       Style           =   1  'Graphical
  66.       TabIndex        =   5
  67.       Top             =   4440
  68.       Width           =   1695
  69.    End
  70.    Begin VB.CommandButton cmdProg4 
  71.       Caption         =   "Program no. 4"
  72.       Height          =   615
  73.       Left            =   1440
  74.       Style           =   1  'Graphical
  75.       TabIndex        =   4
  76.       Top             =   3720
  77.       Width           =   1695
  78.    End
  79.    Begin VB.CommandButton cmdProg3 
  80.       Caption         =   "Program no. 3"
  81.       Height          =   615
  82.       Left            =   1440
  83.       Style           =   1  'Graphical
  84.       TabIndex        =   3
  85.       Top             =   3000
  86.       Width           =   1695
  87.    End
  88.    Begin VB.CommandButton cmdProg2 
  89.       Caption         =   "Program no. 2"
  90.       Height          =   615
  91.       Left            =   1440
  92.       Style           =   1  'Graphical
  93.       TabIndex        =   2
  94.       Top             =   2280
  95.       Width           =   1695
  96.    End
  97.    Begin VB.CommandButton cmdProg1 
  98.       Caption         =   "Program no. 1"
  99.       Height          =   615
  100.       Left            =   1440
  101.       MaskColor       =   &H00808080&
  102.       Style           =   1  'Graphical
  103.       TabIndex        =   1
  104.       Top             =   1560
  105.       Width           =   1695
  106.    End
  107.    Begin VB.Label Label1 
  108.       Caption         =   " DIRECTORY PATH"
  109.       BeginProperty Font 
  110.          Name            =   "Charlesworth"
  111.          Size            =   14.25
  112.          Charset         =   0
  113.          Weight          =   700
  114.          Underline       =   0   'False
  115.          Italic          =   0   'False
  116.          Strikethrough   =   0   'False
  117.       EndProperty
  118.       ForeColor       =   &H00C00000&
  119.       Height          =   495
  120.       Left            =   3360
  121.       TabIndex        =   16
  122.       Top             =   960
  123.       Width           =   2895
  124.    End
  125.    Begin VB.Label lblDir5 
  126.       Height          =   495
  127.       Left            =   3480
  128.       TabIndex        =   10
  129.       Top             =   4440
  130.       Width           =   2775
  131.    End
  132.    Begin VB.Label lblDir4 
  133.       Height          =   495
  134.       Left            =   3480
  135.       TabIndex        =   9
  136.       Top             =   3720
  137.       Width           =   2775
  138.    End
  139.    Begin VB.Label lblDir3 
  140.       Height          =   495
  141.       Left            =   3480
  142.       TabIndex        =   8
  143.       Top             =   3000
  144.       Width           =   2775
  145.    End
  146.    Begin VB.Label lblDir2 
  147.       Height          =   375
  148.       Left            =   3480
  149.       TabIndex        =   7
  150.       Top             =   2400
  151.       Width           =   2775
  152.    End
  153.    Begin VB.Label lblDir1 
  154.       Height          =   375
  155.       Left            =   3480
  156.       TabIndex        =   6
  157.       Top             =   1680
  158.       Width           =   2775
  159.    End
  160.    Begin VB.Label lblTitle 
  161.       Caption         =   "Welcome to ""THE LAUNCHER"""
  162.       BeginProperty Font 
  163.          Name            =   "PosterBodoni BT"
  164.          Size            =   18
  165.          Charset         =   0
  166.          Weight          =   700
  167.          Underline       =   0   'False
  168.          Italic          =   0   'False
  169.          Strikethrough   =   0   'False
  170.       EndProperty
  171.       ForeColor       =   &H00C00000&
  172.       Height          =   615
  173.       Left            =   240
  174.       TabIndex        =   0
  175.       Top             =   120
  176.       Width           =   8775
  177.    End
  178.    Begin VB.Menu mnufile 
  179.       Caption         =   "&File"
  180.       Begin VB.Menu mnuGoto 
  181.          Caption         =   "&Goto"
  182.          Begin VB.Menu mnuProp1 
  183.             Caption         =   "Program &1 Properties"
  184.          End
  185.          Begin VB.Menu mnuProp2 
  186.             Caption         =   "Program &2 Properties"
  187.          End
  188.          Begin VB.Menu mnuProp3 
  189.             Caption         =   "Program &3 Properties"
  190.          End
  191.          Begin VB.Menu mnuProp4 
  192.             Caption         =   "Program &4 Properties"
  193.          End
  194.          Begin VB.Menu mnuProp5 
  195.             Caption         =   "Program &5 Properties"
  196.          End
  197.       End
  198.       Begin VB.Menu mnuEnd 
  199.          Caption         =   "&End"
  200.          Shortcut        =   ^{F4}
  201.       End
  202.    End
  203.    Begin VB.Menu mnuHelp 
  204.       Caption         =   "&Help"
  205.       Begin VB.Menu mnuAbout 
  206.          Caption         =   "&About"
  207.       End
  208.       Begin VB.Menu mnuBugs 
  209.          Caption         =   "&Known Bugs"
  210.       End
  211.       Begin VB.Menu mnutips 
  212.          Caption         =   "&Tips"
  213.       End
  214.    End
  215. Attribute VB_Name = "frmMain"
  216. Attribute VB_GlobalNameSpace = False
  217. Attribute VB_Creatable = False
  218. Attribute VB_PredeclaredId = True
  219. Attribute VB_Exposed = False
  220. Option Explicit
  221. Private Sub cmdProg1_Click()
  222. On Error GoTo error
  223. Dim directory1, program1 As String
  224. If lblDir1.Caption = "" Then
  225. MsgBox "I am sorry but you must specify a program. Select from the properties button!", vbExclamation, "Program error"
  226. ' this code executes the program specified by the user
  227. directory1 = lblDir1.Caption
  228. program1 = Shell(directory1, vbMaximizedFocus)
  229. End If
  230. Exit Sub
  231. error:  MsgBox Err.Description, vbCritical, "An error has occured"
  232. End Sub
  233. Private Sub cmdProg2_Click()
  234. On Error GoTo error
  235. Dim directory2, program2 As String
  236. If lblDir2.Caption = "" Then
  237. MsgBox "I am sorry but you must specify a program. Select from the properties button!", vbExclamation, "Program error"
  238. ' this code executes the program specified by the user
  239. directory2 = lblDir2.Caption
  240. program2 = Shell(directory2, vbMaximizedFocus)
  241. End If
  242. Exit Sub
  243. error:  MsgBox Err.Description, vbCritical, "An error has occured"
  244. End Sub
  245. Private Sub cmdProg3_Click()
  246. On Error GoTo error
  247. Dim directory3, program3 As String
  248. If lblDir3.Caption = "" Then
  249. MsgBox "I am sorry but you must specify a program. Select from the properties button!", vbExclamation, "Program error"
  250. ' this code executes the program specified by the user
  251. directory3 = lblDir3.Caption
  252. program3 = Shell(directory3, vbMaximizedFocus)
  253. End If
  254. Exit Sub
  255. error:  MsgBox Err.Description, vbCritical, "An error has occured"
  256. End Sub
  257. Private Sub cmdProg4_Click()
  258. On Error GoTo error
  259. Dim directory4, program4 As String
  260. If lblDir4.Caption = "" Then
  261. MsgBox "I am sorry but you must specify a program. Select from the properties button!", vbExclamation, "Program error"
  262. ' this code executes the program specified by the user
  263. directory4 = lblDir4.Caption
  264. program4 = Shell(directory4, vbMaximizedFocus)
  265. End If
  266. Exit Sub
  267. error:  MsgBox Err.Description, vbCritical, "An error has occured"
  268. End Sub
  269. Private Sub cmdProg5_Click()
  270. On Error GoTo error
  271. Dim directory5, program5 As String
  272. If lblDir5.Caption = "" Then
  273. MsgBox "I am sorry but you must specify a program. Select from the properties button!", vbExclamation, "Program error"
  274. ' this code executes the program specified by the user
  275. directory5 = lblDir5.Caption
  276. program5 = Shell(directory5, vbMaximizedFocus)
  277. End If
  278. Exit Sub
  279. error:  MsgBox Err.Description, vbCritical, "An error has occured"
  280. End Sub
  281. Private Sub cmdPropProg1_Click()
  282. 'When clicked displays the form for the Properties
  283. frmPropertiesa.Visible = True ' allows the frmProperties to become visible
  284. End Sub
  285. Private Sub cmdPropProg2_Click()
  286. 'When clicked displays the form for the Properties
  287. frmPropertiesB.Visible = True ' allows the frmPropertiesb to become visible
  288. End Sub
  289. Private Sub cmdPropProg3_Click()
  290. frmPropertiesC.Visible = True ' allows the frmPropertiesc to become visible
  291. End Sub
  292. Private Sub cmdPropProg4_Click()
  293. frmPropertiesD.Visible = True ' allows the frmProperties to become visible
  294. End Sub
  295. Private Sub cmdPropProg5_Click()
  296. frmPropertiesE.Visible = True ' allows the frmProperties to become visible
  297. End Sub
  298. Private Sub Form_Load()
  299. 'On Error GoTo error
  300. ' this function loads the registery settings that have
  301. ' been made by the savesetting statement by the code
  302. ' implemented by the properties form
  303. ' the settings load the information into the command
  304. ' button as its caption ie. instead of saying unable
  305. ' to use it states the name of the program entered in by
  306. ' the user
  307. 'If lblDir1.Caption = "" Then
  308.     'cmdProg1.Enabled = False
  309.     'cmdProg1.Caption = "Unable to use"
  310. 'Else
  311.     'cmdProg1.Enabled = True
  312.     cmdProg1.Caption = GetSetting("The Loader", "Caption name", "Text1 cmd")
  313.     lblDir1.Caption = GetSetting("The Loader", "Label Dir1 text", "text1 lbl")
  314.     cmdProg2.Caption = GetSetting("The Loader", "Caption2 name", "text2 cmd")
  315.     lblDir2.Caption = GetSetting("The Loader", "Label Dir2 text", "text2 lbl")
  316.     cmdProg3.Caption = GetSetting("The Loader", "Caption3 name", "text3 cmd")
  317.     lblDir3.Caption = GetSetting("The Loader", "Label Dir3 text", "text3 lbl")
  318.     cmdProg4.Caption = GetSetting("The Loader", "Caption4 name", "text4 cmd")
  319.     lblDir4.Caption = GetSetting("The Loader", "Label Dir4 text", "text4 lbl")
  320.     cmdProg5.Caption = GetSetting("The Loader", "Caption5 name", "text5 cmd")
  321.     lblDir5.Caption = GetSetting("The Loader", "Label Dir5 text", "text5 lbl")
  322. 'End If
  323. 'error:  MsgBox Err.Description, vbCritical, "An error has occured"
  324. ' this code fixes the registery bug
  325. ' -------------------------------------
  326. If cmdProg1.Caption = "" Then
  327. cmdProg1.Caption = "Program no. 1"
  328. End If
  329. If cmdProg2.Caption = "" Then
  330. cmdProg2.Caption = "Program no. 2"
  331. End If
  332. If cmdProg3.Caption = "" Then
  333. cmdProg3.Caption = "Program no. 3"
  334. End If
  335. If cmdProg4.Caption = "" Then
  336. cmdProg4.Caption = "Program no. 4"
  337. End If
  338. If cmdProg5.Caption = "" Then
  339. cmdProg5.Caption = "Program no. 5"
  340. End If
  341. '---------------------------------------
  342. End Sub
  343. Private Sub Form_QueryUnload(fCancel As Integer, UnloadMode As Integer)
  344. ' this queries the form into asking the user if they
  345. ' want to exit the program
  346. Dim response
  347. ' ----------------------------------------------------------------------
  348.     response = MsgBox("Are you sure? (Y/N)", vbExclamation + vbYesNo)
  349.         If (response = vbYes) Then
  350.             fCancel = False
  351.             End ' this lets the program know that it is being
  352.             'terminated
  353.             Else
  354.             fCancel = True
  355.         End If
  356. ' ----------------------------------------------------------------------
  357. End Sub
  358. Private Sub Form_Terminate()
  359. End Sub
  360. Private Sub mnuAbout_Click()
  361. frmAbout.Visible = True
  362. End Sub
  363. Private Sub mnuBugs_Click()
  364. frmBugs.Visible = True
  365. End Sub
  366. Private Sub mnuEnd_Click()
  367. ' this queries the form into asking the user if they
  368. ' want to exit the program
  369. Dim response
  370. ' ----------------------------------------------------------------------
  371.     response = MsgBox("Are you sure? (Y/N)", vbExclamation + vbYesNo)
  372.         If response = vbYes Then
  373.         End
  374.         Unload Me
  375.         End If
  376. ' ----------------------------------------------------------------------
  377. End Sub
  378. Private Sub mnuProp1_Click()
  379. Call cmdPropProg1_Click ' this code calls the events listed in cmdpropprog1_click() event
  380. End Sub
  381. Private Sub mnuProp2_Click()
  382. Call cmdPropProg2_Click
  383. End Sub
  384. Private Sub mnuProp3_Click()
  385. Call cmdPropProg3_Click
  386. End Sub
  387. Private Sub mnuProp4_Click()
  388. Call cmdPropProg4_Click
  389. End Sub
  390. Private Sub mnuProp5_Click()
  391. Call cmdPropProg5_Click
  392. End Sub
  393. Private Sub mnutips_Click()
  394. frmTip.Visible = True
  395. End Sub
  396.